package com.springmq.mq.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName : MqListener
 * @Author : lby
 * @Date: 2021/1/27 16:18
 * @Description : mq监听器
 */
@Slf4j
@Component
public class MqListener {

    /**
     * 监听某个队列下的消息
     */
    @RabbitListener(queues = "first-queue")
    public void messageList(List<String> message){
        log.info("当前队列的消息:{}",message);
    }
}
